﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>呷饭网</title>
    <link rel="stylesheet" type="text/css" href="./styles/mobile.css" />
    <link href="styles/jquery.ui.all.css" rel="stylesheet" />
    <script type="text/javascript" src="scripts/jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="scripts/jquery.bgiframe-2.1.1.js"></script>
    <script type="text/javascript" src="scripts/jquery.ui.core.js"></script>
    <script type="text/javascript" src="scripts/jquery.ui.widget.js"></script>
    <script type="text/javascript" src="scripts/jquery.ui.mouse.js"></script>
    <script type="text/javascript" src="scripts/jquery.ui.button.js"></script>
    <script type="text/javascript" src="scripts/jquery.ui.draggable.js"></script>
    <script type="text/javascript" src="scripts/jquery.ui.position.js"></script>
    <script type="text/javascript" src="scripts/jquery.ui.dialog.js"></script>
    <script type="text/javascript" src="scripts/jquery.ui.datepicker.js"></script>
    <link href="styles/flexy-menu.css" rel="stylesheet" />
    <script type="text/javascript" src="scripts/flexy-menu.js"></script>
    <script type="text/javascript" src="scripts/common.js"></script>

    <script type="text/javascript">
        var PageFlag;
        $(function () {
            $(".flexy-menu").flexymenu({ speed: 100 });
            getUserInfo();
            getListData("", "");
            PageFlag = getParameter("PageFlag");
            $('.goback').click(function () {
                if (PageFlag == "1") {
                    window.location.href = "./manager.html";
                }
                else {
                    window.location.href = "./login.html";
                }
            });
            $("#beginDate").datepicker();
            $("#beginDate").datepicker("option", "dateFormat", "yy-mm-dd");
            $("#endDate").datepicker();
            $("#endDate").datepicker("option", "dateFormat", "yy-mm-dd");
        });

        function getListData(beginDate, endDate) {
            getOrderList(beginDate, endDate);
        }

        //获取酒店待烹饪数据
        function getOrderList(beginDate, endDate) {
            $("#tbllist").html("");

            var datas = "&beginDate=" + beginDate + "&endDate=" + endDate;
            var url = "CommonPage.aspx?opration=getOrderQueryList" + datas;
            $.ajax({
                url: url,
                type: "post",
                dataType: 'json',
                success: function (data) {
                    if (data.Success) {
                        $("#Total").text(data.Total);
                        $(".tips")[0].style.display = "none";
                        var str = "<tr style='background-color:#e9e9e9;'><td class='l'>订单来源</td><td class='l'>房间</td><td class='c'>订单时间</td><td class='c'>订单状态</td></tr>";
                        for (var i = 0; i < data.List.length; i++) {
                            str += "<tr><td class='l'>" + data.List[i].OrderChannel + "</td><td class='l'>" + data.List[i].Dinecondition + "/" + data.List[i].DineName + "</td><td class='c'>" + data.List[i].OrderTime + "</td><td class='c'>" + data.List[i].StateName + "</td></tr>";
                        }
                        $("#tbllist").html(str);
                    }
                    else {
                        $("#Total").text("0");
                        $(".tips")[0].style.display = "";
                        $("#msgtip").text(data.Msg);
                    }
                }
            });
        }

        function orderQuery() {
            var beginDate = $("#beginDate").val();
            var endDate = $("#endDate").val();
            if (beginDate == "") {
                updateTip("请选择订单起始日期！", false, "", "");
                return;
            }
            getOrderList(beginDate, endDate);
        }
    </script>
</head>

<body>
    <div class="wrapall">
        <table class="topbar">
            <tr>
                <td class="l"><a class="goback">返回</a></td>
                <td class="c" id="H_Name" style="display:none;"></td>
                <td class="c">订单查询</td>
                <td class="r" >
                    <ul class="flexy-menu">
                        <li id="lilist">
                        </li>
                    </ul>
                </td>
            </tr>
        </table>
        <table style="border:5px solid #FFF;width:100%;font-family:'微软雅黑', '黑体';font-size:13px;color:#666;">
            <tr>
                <td style="width: 40px; text-align:left;">日期：</td>
                <td style="width: auto">
                    <input type="text" id="beginDate" style="width: 80px;" readonly="readonly" />
                    至
                    <input type="text" style="width: 80px;" id="endDate" readonly="readonly" /></td>
                <td style="width: 60px;">
                    <table class="tblbtn" style="border-bottom: 20px">
                        <tr>
                            <td><a href="#" onclick="orderQuery();">查询</a></td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
        <p class="textinfo">共有<b id="Total">0</b>个订单</p>
        <table class="tbllist" id="tbllist">
        </table>
        <span class="tips" style="display: none;"><i></i><b id="msgtip"></b>

        </span>
        <br />
    </div>
    <div id="dialog" title="提示信息" style="text-align: center; vertical-align: middle;">
        <p class="dialogTip"></p>
    </div>
</body>
</html>
